<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.netcombine.freewill.constants.*, com.netcombine.freewill.lib.Paging,com.netcombine.freewill.vo.PagingVo "%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
Paging paging = (Paging)request.getAttribute("paging");

PagingVo vo = (PagingVo)request.getAttribute("pagingVo"); 

int total_cnt = paging.getTotalCnt();
String searchName = "";
String searchWord = "";
String cmdepth_idx = "";

if(vo != null){
	searchName = vo.getSearchName() == null ? "" : vo.getSearchName();
	searchWord = vo.getSearchWord() == null ? "" : vo.getSearchWord();
}
%>
<html>
<head>
	
	<title><%=PageInfo.TITLE%> - 회원 게시판</title>
<tiles:insertDefinition name="_head" />
	
</head>

<body>
	<div class="wrap">
		
		<tiles:insertDefinition name="_header" />

<!-- Container -->
<div class="container">
<div>
	
	<!-- LNB -->
<tiles:insertDefinition name="_menu" />
<!-- LNB  //-->

<!-- Content -->
<div class="content">
	
	<!-- locatioin -->
<div class="location">
	<h1>회원 게시판 관리</h1>
	<ul>
		<li class="home"><a href="#none"><span>home</span></a> &gt;</li>
		<li><a href="#none"><span>게시판 관리</span></a> &gt;</li>
		<li><strong>회원 게시판</strong></li>
	</ul>
</div>
<!-- locatioin // -->

<!-- member_search -->
<div class="member_search">
	<table summary="회원 게시판 관리, 검색기간, 검색설정">
		<caption>회원 게시판 관리</caption>
		<colgroup>
			<col style="width:15%">
			<col style="width:*;">
			<col style="width:15%">
		</colgroup>
<tbody>
	<tr>
		<th scope="row">
			<select>
				<option>등록일</option>
			</select>
		</th>
		<td>
			<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
			<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
			<script type="text/javascript">
			$(function() {
			$( "#from" ).datepicker({
			  showOn: "button",
			  buttonImage: "<%= PageInfo.IMG_PATH %>/icon_calendar.png",
			  buttonImageOnly: true,
			  dateFormat:"yy-mm-dd",
			  defaultDate: "+1w",
			  changeMonth: true,
			  numberOfMonths: 1,
			  onClose: function( selectedDate ) {
				$( "#to" ).datepicker( "option", "minDate", selectedDate );
			  }
			});
			$( "#to" ).datepicker({
			  showOn: "button",
			  buttonImage: "<%= PageInfo.IMG_PATH %>/icon_calendar.png",
			  buttonImageOnly: true,
			  dateFormat:"yy-mm-dd",
			  defaultDate: "+1w",
			  changeMonth: true,
			  numberOfMonths: 1,
			  onClose: function( selectedDate ) {
				$( "#from" ).datepicker( "option", "maxDate", selectedDate );
			  }
			});
			 });
</script>
					<input type="text" id="from" name="from" title="검색 시작날짜" class="i_text inw8" /> ~ 
					<input type="text" id="to" name="to" title="검색 마지막날짜" class="i_text inw8" />
				</td>
				<td rowspan="4" class="txtC"><span class="btn_member bgnone"><a href="#none">검색</a></span></td>
			</tr>
			<tr>
				<th scope="row">
					<select>
						<option>제목</option>
						<option>작성자</option>
					</select>
				</th>
				<td><input type="text" title="검색" class="i_text inw3"></td>
			</tr>
			<tr>
				<th scope="row">공유</th>
				<td>
					<label for=""><input type="checkbox"> 전체 <input type="checkbox"> 물품 <input type="checkbox"> 재능 <input type="checkbox"> 장소</label>
				</td>
			</tr>
			<tr>
				<th scope="row">요청</th>
				<td>
					<label for=""><input type="checkbox"> 전체 <input type="checkbox"> 물품 <input type="checkbox"> 재능 <input type="checkbox"> 장소</label>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<!-- member_search // -->

<!-- search detail -->
<div class="search_detail">
	<p class="txt">총 <span><%=total_cnt %></span> 건</p>
	<p class="right btn_excel"> <a href="#none">EXCEL 저장</a></p>
</div>
<!-- search detail // -->

<!-- table -->
<div class="tb_list1 tb_mem1">
	<table summary="번호, 구분, 제목, 작성자, 작성일, 하위 커뮤니티 게시기간, 상위 커뮤니티 게시기간, 게시한 커뮤니티, 찜, 좋아요, 댓글">
		<caption>회원 게시판 리스트</caption>
		<colgroup>
			<col style="width:8%;">
			<col style="width:6%;">
			<col style="width:*;">
			<col style="width:10%;">
			<col style="width:10%;">
			<col style="width:19%;">
			<col style="width:7%;">
			<col style="width:7%;">
			<col style="width:7%;">
			<col style="width:7%;">
		</colgroup>
		<thead>
		<tr>
			<th scope="col" rowspan="2"><div>No.</div></th>
			<th scope="col" rowspan="2"><div>구분</div></th>
			<th scope="col" rowspan="2"><div>제목</div></th>
			<th scope="col" rowspan="2"><div>작성자</div></th>
			<th scope="col" rowspan="2"><div>작성일</div></th>
			<th scope="col"><div>하위 커뮤니티 게시기간</div></th>
			<th scope="col" rowspan="2"><div>게시한 커뮤니티</div></th>
			<th scope="col" rowspan="2"><div>찜</div></th>
			<th scope="col" rowspan="2"><div>좋아요</div></th>
			<th scope="col" rowspan="2"><div >댓글</div></th>
		</tr>
		<tr>
			<th scope="col"><div>상위 커뮤니티 게시기간</div></th>
		</tr>
		</thead>
		<tbody>
		<%
			if (total_cnt != 0) {
		%>
				<c:forEach items="${userboardList}" var="vo">				
		<tr>
			<td rowspan="2"><c:out value="${vo.cmwrite_idx}" /></td>
			<td rowspan="2"><c:out value="${vo.cmwrite_type}" /></td>
			<td rowspan="2"><c:out value="${vo.cmwrite_title}" /></td>
			<td rowspan="2"><c:out value="${vo.mb_idx}"/></td>
			<td rowspan="2"><c:out value="${vo.cmwrite_regdate}"/></td>
			<td rowspan="2"><c:out value="${vo.cmwrite_lstdate} ${vo.cmwrite_leddate}" /></td>
			<td colspan="3">게시한 커뮤니티</td>
			<td colspan="3">찜</td>
			<td colspan="3">좋아요</td>
			<td colspan="3">댓글</td>
		</tr>
		<tr>
			<td>2013-12-05 ~ 2013-12-19</td>
		</tr>			
		</c:forEach>
		
		<%
		} 
		%>
				
		</tbody>
	</table>
</div>
<!-- table // -->

<!-- paging -->
${paging.getPagingHtml()}
<!-- paging // -->

</div>
<!-- Content // -->
</div>
</div>
<!-- Container // -->
	</div>
<form name="pageForm" method="POST">
<input type="hidden" name="page" value="${pagingVo.page}"/>
<input type="hidden" name="searchName" value="${pagingVo.searchName}"/> 
<input type="hidden" name="searchWord" value="${pagingVo.searchWord}" />
</form>
</body>
</html>